import instance from '../axios_config'

const get_onemenus = async (url: string) => {
  const Data = await instance.get(url)
  return Data.data
}

const add_onemenus = async (url: string, data: any) => {
  const Data = await instance.post(url, data)
  return Data.data
}

const delete_onemenus = async (url: string, id: string) => {
  const path = url + '/' + id + '/'
  const Data = await instance.delete(path)
  return Data.data
}

const edit_onemenus = async (url: string, data: any) => {
  const path = url + '/' + data.id + ' /'
  const Data = await instance.put(path, data)
  return Data.data
}

export default {
  get_onemenus,
  add_onemenus,
  delete_onemenus,
  edit_onemenus
}
